package com.kuangjia.conferenceroomrental.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.Builder;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 会议室实体类
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("rooms")
public class Room implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    
    /**
     * 会议室名称
     */
    @NotBlank(message = "会议室名称不能为空")
    @TableField("name")
    private String name;
    
    /**
     * 容纳人数
     */
    @NotNull(message = "容纳人数不能为空")
    @Positive(message = "容纳人数必须大于0")
    @TableField("capacity")
    private Integer capacity;
    
    /**
     * 位置
     */
    @TableField("location")
    private String location;
    
    /**
     * 设备
     */
    @TableField("equipment")
    private String equipment;
    
    /**
     * 状态
     */
    @NotBlank(message = "状态不能为空")
    @TableField("status")
    private String status; // AVAILABLE, MAINTENANCE
    
    /**
     * 创建时间
     */
    @TableField("created_at")
    private LocalDateTime createdAt;
    
    /**
     * 更新时间
     */
    @TableField("updated_at")
    private LocalDateTime updatedAt;
} 